2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
8 namespace SuperPolarity
12 protected ParticleEngine particleEngine;
15 public Bullet(SuperPolarity newGame)
22 particleEngine = null;
25 public override void Initialize(Texture2D texture, Vector2 position)
27 base.Initialize(texture, position);
33 particleEngine = ParticleEffectFactory.CreateBullet(position);
36 public override void Update(GameTime gameTime)
38 Velocity.X = (float)(MaxVelocity * Math.Cos(Angle));
39 Velocity.Y = (float)(MaxVelocity * Math.Sin(Angle));
46 particleEngine.Update();
47 particleEngine.EmitterLocation = Position;
50 public override void Draw(SpriteBatch spriteBatch)
52 base.Draw(spriteBatch);
53 particleEngine.Draw(spriteBatch);
56 public override void Collide(Actor other, Rectangle collision)
58 if (Dying) { return; }
59 if (other.GetType().IsAssignableFrom(typeof(StandardShip)))
66 protected override void Die()
68 ActorManager.CheckOut(this);
69 Parent.Children.Remove(this);